<?php


namespace app\api\controller\v1;


use app\api\model\EventNoticeReceiverModel;
use app\common\controller\UserBaseController;

class EventController extends UserBaseController {

    function notice_receivers_listAction() {
        $this->paramlist = array(
            'token' => 'string',
        );

        $this->check_params();
        $this->check_token();

        $m = (new EventNoticeReceiverModel())->query_list($this->city_id);
        $this->resp['list'] = array_values($m);

        return $this->ret_resp();
    }

    function set_notice_receiversAction() {
        $this->paramlist = array(
            'token' => 'string',
            'event_type' => 'int',
            'receivers' => 'array',
        );
        $this->check_params();
        $this->check_token();

        (new EventNoticeReceiverModel())->set_recvrer($this->city_id, $this->argv['event_type'], $this->argv['receivers']);

        return $this->ret_resp();
    }

}
